package com.gistmap.ntdc.persistence.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author zhangran
 * @date 2018/12/24
 */
@Getter
@Setter
@Entity
@Table(name = "merchant_order_detail")
@EntityListeners(AuditingEntityListener.class)
public class MerchantOrderDetail {

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "merchant_order_id")
    private MerchantOrder merchantOrder;


    private String merchandiseSnapshot;
    private Integer count;
    private Integer amount;
    private Integer discount;

    @LastModifiedDate
    private Date updatedTime;

    @CreatedDate
    private Date createdTime;
}
